package com.luoxiang.socialandroid.activity;

import static android.animation.ValueAnimator.REVERSE;

import androidx.appcompat.app.AppCompatActivity;

import android.animation.ValueAnimator;
import android.os.Bundle;
import android.widget.ScrollView;

import com.luoxiang.socialandroid.R;
import com.luoxiang.socialandroid.base.BaseActivity;

public class SeaLoginActivity extends BaseActivity {
    private ScrollView mScrollView;
    @Override
    protected void initListener() {
        mScrollView.post(new Runnable() {
            @Override
            public void run() {
                ValueAnimator animator = (ValueAnimator) ValueAnimator.ofInt(0, mScrollView.getChildAt(0).getMeasuredHeight());
                animator.setDuration(30000);
                animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public void onAnimationUpdate(ValueAnimator animation) {
                        int mFloat = (int) animation.getAnimatedValue();
                        mScrollView.scrollTo(0, mFloat);
                    }
                });
                animator.setRepeatCount(50);
                animator.setRepeatMode(REVERSE);
                animator.start();
            }
        });
    }

    @Override
    protected void initLayout(Bundle savedInstanceState) {
        setContentView(R.layout.activity_loginsea);
        setStatusBarTranslucent();

    }

    @Override
    protected void initView() {
        mScrollView = findViewById(R.id.mScrollView);
    }
}